﻿package com.reyco1.events
{
	/*
	imports
	*/
	import flash.events.Event;
	import com.reyco1.util.ClassUtil;
	/*
	class
	*/
	public class BaseEvent extends Event
	{
		/*
		variables
		*/
		public var params:Object;
		/*
		Constructor
		*/
		
		/**
		 * Base event which all custom events must extend in order to have output functionality and be able to carry parameters onto listeners
		 * @param $type : the constant event 
		 * @param $params : an object containing any number of values to be sent to listeneers
		 * @return : a reference ot the event
		 * 
		 */		
		public function BaseEvent($type:String, $params:Object = null)
		{
			super($type, true, true);
			this.params = $params
		}
		
		/**
		 * Overrides the flash.events.Event's clone method
		 * @return Event
		 * 
		 */		
		public override function clone():Event
		{
			return new BaseEvent(this.type, this.params);
		}
		
		/**
		 * Overrides the flash.events.Event's toString method
		 * @return 
		 * 
		 */		
		override public function toString():String
		{
			return ClassUtil.className(this);
		}
	}

}